package org.pisces.wechat.enums;

import java.util.List;

import org.apache.commons.lang3.EnumUtils;

public enum  EEventType implements EnumIdentifiable<String>{
	SUBSCRIBE("subscribe","订阅事件"),  
	UNSUBSCRIBE("unsubscribe","取消订阅事件"),  
	LOCATION("LOCATION","上报地理位置事件"),
	CLICK("CLICK","点击菜单拉取消息时的事件"),  
	VIEW("VIEW","点击菜单跳转链接时的事件"),
	KFCREATE("kf_create_session","创建客服链接"),
	KFCLOSE("kf_close_session","关闭客服链接"),
	TEMPLATESENDJOBFINISH("TEMPLATESENDJOBFINISH","模板消息"),
	;
    private String value;
    
    private String desc;
  
    EEventType(String value,String desc) {  
        this.value = value;  
        this.desc= desc;
    }  
    
    public String getDesc(){
    	return desc;
    }
    
    public String getValue(){
    	return value;
    }
    
	public static List<EEventType> ALL = EnumUtils.getEnumList(EEventType.class);
	
	public static EEventType getEventType(String typeVal) {
		for (EEventType type : ALL) {
			if(type.value.equals(typeVal)) {
				return type;
			}
		}
		return null;
	}




	@Override
	public String getIdentifiable() {
		return this.getValue();
	}
}
